<h1><?php echo $send_title ?></h1>

<?php if (!empty($smtp_errors)): ?>
<div class="error">
    <?php echo $smtp_errors; ?>
</div>
<?php endif; ?>
<?php echo $this->Form->create('Booking', array('url' => '/' . $this->params['url']['url'])) ?>
<table class="email">
    <tr>
        <td>Tên người nhận <span class="compulsory">*</span></td>
        <td><?php echo $this->Form->input('Email.receiver_name', array('type' => 'text', 'class' => 'textfield', 'label' => false, 'value' => $receiver_name)); ?></td>
    </tr>
    <tr>
        <td>Email người nhận <span class="compulsory">*</span></td>
        <td><?php echo $this->Form->input('Email.receiver_email', array('type' => 'text', 'class' => 'textfield', 'label' => false, 'value' => $receiver_email)); ?></td>
    </tr>
    <tr>
        <td>Tiêu đề <span class="compulsory">*</span></td>
        <td><?php echo $this->Form->input('Email.title', array('type' => 'text', 'class' => 'textfield', 'label' => false, 'value' => $email_title)); ?></td>
    </tr>
    <tr>
        <td>Nội dung <span class="compulsory">*</span></td>
        <td>
            <?php echo $this->Form->input('Email.email_content', array('type' => 'textarea', 'class' => 'ckeditor', 'label' => false, 'value' => $this->element('email/html/' . $email_template, array('booking' => $booking)))); ?>
        </td>
    </tr>
    <tr>
        <td></td>
        <td>
            <?php echo $this->Form->submit('Gửi', array('class' => 'button', 'div' => false)); ?>
            <?php echo $this->Form->submit('Quay lại', array('class' => 'button', 'onclick' => "return back_to_index()", 'div' => false)); ?>
            <script type="text/javascript">
            function back_to_index()
            {
                window.location = '<?php echo $this->Html->url(array('controller' => 'bookings', 'action' => 'show', $booking['Booking']['id'])) ?>';
                return false;
            }
            </script>
        </td>
    </tr>
</table>
<?php echo $this->Form->end(); ?>